package springcloud.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @author kaivader
 */
@RestController
@RequestMapping("/consumer")
@Slf4j
public class OrderController {
    //    private final String PAYMENT_URL = "http://localhost:8001";
    private final String INVOKE_URL = "http://cloud-payment-service";

    @Resource
    private RestTemplate restTemplate;

    @GetMapping("/payment/zk")
    public Object zk() {
        return restTemplate.getForObject(INVOKE_URL + "/payment/zk", String.class);
    }


}
